#include "ParticleSteel.h"

#include "ParticleContext.h"
#include "DescriptorParticle.h"

#//include "StreamBinary.h"

using namespace ParticleEngine; 

const DescriptorParticle ParticleSteel::Descriptor
(
	"Steel", 
	[](ParticleContext& NewContext) { return new ParticleSteel(NewContext); }
); 

ParticleSteel::ParticleSteel(ParticleContext& NewContext) :
ParticleBase(NewContext, &ParticleSteel::Descriptor),
Heat(1.0f),
Electricity(1.0f)
{
	Adhesions = new PropertyAdhesions(0.2f);
	Adhesions->ParticleCast = this;
}
ParticleSteel::~ParticleSteel()
{
}

void ParticleSteel::Sole()//einzelne aktualisierzung
{
	this->SoleStandard();

	this->Heat.Sole();
	this->Electricity.Sole();
}
void ParticleSteel::InteractionIndividual(ParticleBase*const Other, Vec<2, float>& Space, const float& DistanceSquared)
{
	this->InteractionKinetics(Other, Space, DistanceSquared);

	this->Heat.Interaction(Other->HasHeat());
	this->Electricity.Interaction(Other->HasElectricity());
}

ColorRGBA<unsigned char> ParticleSteel::GetColor()
{
	return ColorRGBA<unsigned char> (100, 100, 100, 255);
}

void ParticleSteel::SaveIndividual(std::ofstream& Strm)
{
	Heat.Save(Strm);
	Electricity.Save(Strm);
}
void ParticleSteel::LoadIndividual(std::ifstream& Strm)
{
	Heat.Load(Strm);
	Electricity.Load(Strm);
}